const state = {
  title: '优越定制APP后台管理系统',
  showSettings: false,
  tagsView: false,
  fixedHeader: true,
  sidebarLogo: true,
  errorLog: 'production',
  backRoute: null
}

const mutations = {
  CHANGE_SETTING: (state, {
    key,
    value
  }) => {
    if (Object.prototype.hasOwnProperty.call(state, key)) {
      state[key] = value
    }
  }
}

const actions = {
  changeSetting ({
    commit
  }, data) {
    commit('CHANGE_SETTING', data)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
